package com.tianda.his.commons.exception;


import com.tianda.his.commons.vo.AjaxResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class CustomExceptionHandler {

    @ExceptionHandler(BusinessException.class)
    public AjaxResult handleBusinessException(final BusinessException e) {
        return AjaxResult.error(e.getCode(), e.getMessage());
    }
}
